package com.darrenchan.netease04

object GenericTypeTest {
  def main(args: Array[String]): Unit = {
    val array = new Array[String](10)

    array(0) = "陈驰"

    val cc = new MrRight[Int]()
    cc.hello(123)

    val ll = new MrLeft()
    ll.hello[String]("陈驰")
  }
}


//泛型类
class MrRight[T] {
  def hello(value: T) = {
    println(value)
  }
}

//泛型方法
class MrLeft {
  def hello[T](value: T) = {
    println(value)
  }
}